export default {
    tabs: true,
    tabsActive: 1,
    group: [
        {
            label: '个人信息',
            prop: 'info',
            column: [{
            label: '头像',
            type: 'upload',
            listType: 'picture-img',
            propsHttp: {
                url: 'data'
            },
            canvasOption: {
                text: ' ',
                ratio: 0.1
            },
            action: '/api/dis-dashboard/oss/file/upload',
            tip: '只能上传jpg/png用户头像，且不超过500kb',
            span: 12,
            row: true,
            prop: 'avatar'
            }, {
            label: '姓名',
            span: 12,
            row: true,
            prop: 'name'
            }, {
            label: '用户名',
            span: 12,
            row: true,
            prop: 'realName'
            }, {
            label: '手机号',
            span: 12,
            row: true,
            prop: 'phone'
            }, {
            label: '邮箱',
            prop: 'email',
            span: 12,
            row: true,
            }]
        },
        {
            label: '修改密码',
            prop: 'password',
            column: [
                {
                    label: '原密码',
                    span: 12,
                    row: true,
                    type: 'password',
                    prop: 'oldPassword',
                    rules: [
                        {
                            required: true,
                            message: "请输入原密码",
                            trigger: "blur"
                        }
                    ]
                },
                {
                    label: '新密码',
                    span: 12,
                    row: true,
                    type: 'password',
                    prop: 'newPassword',
                    rules: [
                        { required: true, message: "请输入原密码", trigger: "blur" },
                        { min: 8, message: '长度至少8个字符', trigger: 'blur' },
                        {
                            validator: (rule, value, callback) => {
                                // 是数字
                                let isDigit = /^.*[0-9]+.*/;
                                // isLowerCase 字母
                                let isCase = /^.*[a-zA-Z]+.*/;
                                // isUpperCase 大写字母
                                // let isUpperCase = /^.*[A-Z]+.*/;
                                // 特殊字符
                                let regEx = /^.*[^a-zA-Z0-9]+.*/;
                                if (!isDigit.test(value) || !isCase.test(value) || !regEx.test(value)) {
                                    callback(new Error('密码必须同时包含数字、字母、特殊字符！'))
                                }
                            },
                            trigger: 'blur'
                        }
                    ]
                },
                {
                    label: '确认密码',
                    span: 12,
                    row: true,
                    type: 'password',
                    prop: 'newPassword1',
                    rules: [
                        { required: true, message: "请输入原密码", trigger: "blur" },
                        { min: 8, message: '长度至少8个字符', trigger: 'blur' },
                        {
                            validator: (rule, value, callback) => {
                                // 是数字
                                let isDigit = /^.*[0-9]+.*/;
                                // isLowerCase 字母
                                let isCase = /^.*[a-zA-Z]+.*/;
                                // isUpperCase 大写字母
                                // let isUpperCase = /^.*[A-Z]+.*/;
                                // 特殊字符
                                let regEx = /^.*[^a-zA-Z0-9]+.*/;
                                if (!isDigit.test(value) || !isCase.test(value) || !regEx.test(value)) {
                                    callback(new Error('密码必须同时包含数字、字母、特殊字符！'))
                                }
                            },
                            trigger: 'blur',

                        }
                    ]
                }
            ]
        }
    ]
}
